<%--
  Created by IntelliJ IDEA.
  User: cos
  Date: 2022/3/9
  Time: 14:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>

<table>
    <thead>
    <tr>
        <td>id</td>
        <td>ename</td>
        <td>sex</td>
        <td>age</td>
        <td>bornDate</td>
    </tr>
    </thead>
    <tbody id="body">

    </tbody>
</table>
<script>
    $(function () {
        $.ajax({
            type:"get",
            url:"/ajax/getUserList",
            success:function (data) {
                console.log(data)
                for (let x in data) {
                    $("#body").append("    <tr>" +
                        "        <td>"+data[x].id+"</td>" +
                    "        <td>"+data[x].name+"</td>" +
                    "        <td>"+data[x].sex+"</td>" +
                    "        <td>"+data[x].age+"</td>" +
                    "        <td>"+data[x].bornDate+"</td>" +
                    "    </tr>");
                }
            }
        })
    })



</script>
</body>
</html>
